

/**
 * 上传文件公共方法
 */
function uploadCustomer(){
	var win;
	//目标页面
	var target='/tools/html5upload/index.html';
    //判断是否打开 
    if (win == null || win.closed) {
    	win=window.open (target, '_blank', 'channelmode=yes,height=500, width=800, top=200,left=500, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no') 
    } else {
    	swal("操作失败!", "请先关闭其他已打开的上传页面", "info");
    }
	win.onload = function() {
		win.createUploadDiv({
			pageName:"上传客户订单信息",
			justImage:false,					//是否只能上传图片
			reloadParent:false,				    //关闭上传页是否刷新父页面
			closeChild:true,				    //刷新父页面是否关闭上传页
			completeClose:true,				    //上传完成自动关闭
			url:"/ctm/order/saveExcel.do",
			callback_succ:function(file, data){
				if(data.flag != "success"){
             		swal("操作失败!", data.message, "error");
             	}else{
             		swal("操作成功!", data.message, "success");
             	}
			},
			callback_fail:function(file){
				return "fail";
			}
		});
	} 
}

//处理上传数据
function dealCustomer() {
	var title = "确认要处理数据么？";
	var src = "/ctm/order/dealCustomer.do";
	$.SwalAjaxRequestHelper.AjaxSwalRequest(title, src, {"do" : "do"}, null);
}

function downModel() {
	window.location.href = "/model/ctsorders.xls";
}

//处理历史数据
function dealHistoryDate() {
	var title = "确认要处理历史数据么？";
	var src = "/ctm/order/temp/dealHistoryCustomer.do";
	$.SwalAjaxRequestHelper.AjaxSwalRequest(title, src, {"do" : "do"}, null);
}


